package leetcode_bin_tree_test;

import bin_tree.TreeNode;

/**
 * 剑指 Offer 55 - I. 二叉树的深度
 */
public class Depth {
    public int maxDepth(TreeNode root) {
        if (root == null) {
            return 0;
        }
        int left = maxDepth(root.left);
        int right = maxDepth(root.right);
        return Math.max(left + 1, right + 1);
    }
}
